<?php
class Cache {
    public static function get($key) {
        //读取文件./cache
        $file = './cache/' . hash("sha256",$key) . '.cache';
        if (file_exists($file)) {
            $result = json_decode(file_get_contents($file),true);
            if ($result['time'] > time()) {
                return $result;
            }
        } else {
            return false;
        }
    }
}
$Cache = new Cache();